import request from '@/utils/request'

export function getDepartments() {
  return request({
    url: '/company/department'
  })
}
/**
 * 根据ID删除部门
*/
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

/**
 * 新增部门
*/

export function addDepartment(data) {
  return request({
    url: `/company/department`,
    method: 'POST',
    data
  })
}

/**
 * 根据ID修改部门信息
*/
export function updateDepartment(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}

/**
 * 根据ID获取部门详情
*/
export function getDepartmentDtail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
